<article>
  <% if (item.link){ %>
  <% if (item.title){ %>
  <h3 class="article-title"><a href="<%- item.link %>" target="_blank"><span><%= item.title %></span></a></h3>
  <% } else { %>
  <h3 class="article-title"><a href="<%- item.link %>" target="_blank"><span><%= item.link %></span></a></h3>
  <% } %>
  <% } else { %>
  <% if (index){ %>
  <h3 class="article-title"><a href="<%- config.root %><%- item.path %>"><span><%= item.title %></span></a></h3>
  <% } else { %>
  <h3 class="article-title"><span><%= item.title %></span></h3>
  <% } %>
  <% } %>

  <div class="article-top-meta">
    <span class="posted-on">
      <a href="<%- config.root %><%- item.path %>" rel="bookmark">
        <time class="entry-date published" datetime="<%= item.date.toDate().toISOString() %>">
          <%= item.date.format(config.date_format) %>
        </time>
      </a>
    </span>
  </div>


  <% if (item.photos){ %>
  <div class="featured-media">
    <img src="<%- item.photos %>" class="attachment-post-thumbnail size-post-thumbnail">
  </div>
  <% } %>

  <div class="article-content">
    <div class="entry">
      <% if (item.excerpt && index){ %>
      <%- item.excerpt %>
      <% if (theme.read_more_btn){ %>
      <p><a class="excerpt-btn" href="<%- config.root %><%- item.path %>"><span><%- __('read_more') %></span></a></p>
      <% } %>
      <% } else { %>
      <%- item.content %>
      <% } %>
    </div>

  </div>

  <div class="article-footer">
    <div class="article-meta pull-left">

      <% if (item.categories && item.categories.length){ %>
      <%
        var cats = [];
        item.categories.forEach(function(cat){
            cats.push('<a href="' + cat.path + '">' + cat.name + '</a>');
        });
      %>

      <span class="post-categories">
        <i class="icon-categories"></i>
        <%- cats.join(', ') %>
      </span>
      <% } %>

      <% if (item.tags && item.tags.length){ %>
      <%
        var tags = [];
        item.tags.forEach(function(tag){
            tags.push('<a href="' +  tag.path + '">' + tag.name + '</a>');
        });
    %>

      <span class="post-tags">
        <i class="icon-tags"></i>
        <%- tags.join('') %>
      </span>
      <% } %>

    </div>

    <% if (index && (theme.disqus || theme.gitment || theme.gittalk || theme.valine || theme.utterances|| theme.livere || theme.giscus)) { %>
    <div class="article-meta pull-right">
      <span>
        <i class="icon-comments"></i>
        <span>
          <a href="<%- config.root %><%- item.path %>#comment"><%- __('comment', { item }) %></a>
        </span>
      </span>
    </div>
    <% } %>
  </div>
</article>